(function () {
    var musicContainer = document.querySelector(".music");
    var music = document.querySelector("#music");
    window.setTimeout(function () {
        music.play();
        music.addEventListener("canplay", function () {
            musicContainer.className = "music musicCur";
        });
    }, 1000);
    musicContainer.addEventListener("click", function () {
        //paused属性判断音频文件是播放的还是停止 beyond.paused=true说明音频文件目前是停止播放
        //让音频文件播放play(),让音频文件停止是pause();
        if (music.paused) {//停止
            music.play();
            musicContainer.className = "music musicCur";
        } else {
            music.pause();
            musicContainer.className = "music";
            musicContainer.style.opacity = 1;
        }
    }, false);
})();
